package com.mldong.modules.sys.vo;

import cn.hutool.core.util.StrUtil;
import com.mldong.modules.sys.entity.Dept;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 部门
 * </p>
 *
 * @author mldong
 * @since 2022-10-18
 */
@Data
@ApiModel(value = "DeptVO对象", description = "部门VO")
public class DeptVO extends Dept {
    @ApiModelProperty(value = "部门负责人ID集合")
    private List<Long> leaderIdList;

    public List<Long> getLeaderIdList() {
        this.leaderIdList = new ArrayList<>();
        if(StrUtil.isNotEmpty(super.getLeaderIds())){
            String [] arr = super.getLeaderIds().split(",");
            for (String s : arr) {
                this.leaderIdList.add(Long.valueOf(s));
            }
        }
        return leaderIdList;
    }
}
